<html>

<head>

${inc:/action/pub/common}
<title>归档</title>

</head>

<body>


<br>
<center>

<div id="form">
<form name="formEditor" onsubmit="return insert()">
    
<TABLE class="table_comm" cellSpacing=0 cellPadding=0 width="100%" border=0>
<!-- 页面内容标签：如“新增记录”、“修改记录” -->
<tr>
<td>
<div id=tabs>
    <ul>
        <li onclick="changeLiStyle(this);" id="tabsl">
            <a  
                onmouseover="javascript:window.status='';return true;" 
                onmouseout="javascript:window.status='';return true;" 
                href='#' 
                onclick='JavaScript:return false;'>
                <span id="formTitleEditor">档案信息</span>
            </a>
        </li>
    </ul>
    <div id='hline'></div>
</div>
</tr>
</td>
</table>

<FIELDSET><LEGEND>档案信息</LEGEND>
<TABLE class="table_comm" cellSpacing=0 cellPadding=0 width="100%" border=0>
    <tr>
        <td class="th20 required">项目名称</td>
        <td class="td20left">
            ${fld:project_name@js}
			<input type="hidden" name="project_tuid" value="${fld:project_tuid}">
        </td>
    </tr>
    <tr>
        <td class="th20 required">户主</td>
        <td class="td20left">
            ${fld:master_name@js}
			<input type="hidden" name="master_tuid" value="${fld:master_tuid}">
        </td>
    </tr>
    <tr>
        <td class="th20">分配户型</td>
        <td class="td20left">
            ${fld:room_type@js}
			<input type="hidden" name="house_type_tuid" value="${fld:house_type_tuid}">
			<input type="hidden" name="room_type" value="${fld:room_type}">
        </td>
    </tr>
    <tr>
        <td class="th20">小区名称</td>
        <td class="td20left">
            ${fld:location_name1@js}
			<input type="hidden" name="location_tuid" value="${fld:location_tuid}">
			<input type="hidden" name="location_name1" value="${fld:location_name1}">
        </td>
    </tr>
     <tr>
        <td class="th20">分配楼源</td>
        <td class="td20left">
            ${fld:house_name@js}
			<input type="hidden" name="house_tuid" value="${fld:house_tuid}">
			<input type="hidden" name="house_name" value="${fld:house_name}">
        </td>
    </tr>
	<tr>
        <td class="th20">建筑面积</td>
        <td class="td20left">
            ${fld:jianzhu_area}
			<input type="hidden" name="jianzhu_area" value="${fld:jianzhu_area}">
        </td>
    </tr>
    <tr>
        <td class="th20">档案编号</td>
        <td class="td20left">
            <input type="text" name="archives_no" value="">
        </td>
    </tr>
    <tr>
        <td class="th20">档案存放物理位置</td>
        <td class="td20left">
            <input type="text" name="place_name" value="">
        </td>
    </tr>
    <tr>
        <td class="th20">备注</td>
        <td class="td20left">
            <input type="text" name="remark" value="">
        </td>
    </tr>
</TABLE>
</FIELDSET>

<FIELDSET><LEGEND>操作信息</LEGEND>
<TABLE class=table_comm cellSpacing=0 cellPadding=0 width="100%" border=0>
        <col width="80%">
        <col width="20%">
        <!--buttons-->
        <tr>
            <td align="center" colspan=1>
                <input type="submit" class="cmd" value="保存">
                <input type="button" class="cmd" value="返回" onclick="window.close();" >
            </td>
            <td class="th20 required" colspan=3>
                特别标注为必填信息.
            </td>
        </tr>
    
</table>
</FIELDSET>

    <input type="hidden" name="tuid" value="">
    </form>
</div>

<!--panel de respuesta AJAX #2 insert/update-->
<div id="response" style="display:none;width:100%">
</div>

<!--indicador de progreso-->
<br>
<div id="status" class="alert" style="text-align:left; display:none;color:gray;width:150px;font-weight:bold;font-family:Arial">
    <img src="${def:context}/images/progress.gif"> 请稍候！
</div>

</center>
<!--codigo de soporte del template-->
<script type="text/javascript">
    //返回
    function goBack() 
    {
        _goBackFn()         
    }
    
    //加载数据
    function edit(id)
    {
            ajaxCall(httpMethod="GET", 
                            uri="${def:actionroot}/edit?id=" + id, 
                            divResponse="form", 
                            divProgress="status", 
                            formName=null, 
                            afterResponseFn=null, 
                            onErrorFn=null);    
    }
    
    //更新数据
    function insert()
    {       
			_goBackFn = showEdit;
			if(document.formEditor.tuid.value != ""){
				return ajaxCall(httpMethod="POST", 
                            uri="${def:actionroot}/update", 
                            divResponse="response", 
                            divProgress="status", 
                            formName="formEditor", 
                            afterResponseFn=null, 
                            onErrorFn=showEdit);
			}else{
				return ajaxCall(httpMethod="POST", 
                            uri="${def:actionroot}/insert", 
                            divResponse="response", 
                            divProgress="status", 
                            formName="formEditor", 
                            afterResponseFn=null, 
                            onErrorFn=showEdit);
            }
    }
    
    function showForm()
    {
        document.getElementById("form").style.display="";
    }

    function showEdit()
    {
            document.getElementById("form").style.display="";
            document.getElementById("response").style.display="none";
    }
	if("${fld:tuid}" != ""){
		//加载档案信息
		edit("${fld:tuid}");
	}
    
</script>
</body>
</html>
